#include <stdio.h>
//将计算过的结果缓存起来
int cache[32][32][32] = { 0 };
int w(int a, int b, int c)
{
    int ret;
    if (a <= 0 || b <= 0 || c <= 0)
    {
        return 1;
    }

    if (a > 20 || b > 20 || c > 20)
    {
        return w(20, 20, 20);
    }
    
    if (cache[a][b][c])
    {
        return cache[a][b][c];
    }

    if (a < b && b < c)
    {
        ret = w(a, b, c - 1) 
            + w(a, b - 1, c - 1) 
            - w(a, b - 1, c);
    }
    else 
    {
        ret = w(a - 1, b , c)
            + w(a - 1, b - 1, c)
            + w(a - 1, b, c - 1)
            - w(a - 1, b - 1, c - 1);
    }
    
    cache[a][b][c] = ret;
    return ret;
}

int main(int argc, char const *argv[])
{
    int a[102400], b[102400], c[102400], index = 0, i;
    
    do
    {
        scanf("%d%d%d", &a[index], &b[index], &c[index]);
        index++;
    } while (!(a[index - 1] == -1 
        && b[index - 1] == -1 
        && c[index - 1] == -1));
    index--;

    if (index == 0)
    {
        return 0;
    }

    printf("w(%d, %d, %d) = %d", a[0], b[0], c[0], w(a[i], b[i], c[i]));
    
    for (i = 1; i < index; i++)
    {
        printf("\nw(%d, %d, %d) = %d", a[i], b[i], c[i],
            w(a[i], b[i], c[i]));
    }
    
    return 0;
}
